package com.glsc.ngateway.flowable.listener.remind;

import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class RemindStartHandler implements ExecutionListener {

    private static final Logger logger = LoggerFactory.getLogger(RemindStartHandler.class);


    @Override
    public void notify(DelegateExecution execution) {

//        try {
//
//            String content = execution.getVariable("content").toString();
//
//            JSONObject json = JSONObject.parseObject(content);
//            JSONObject js = json.getJSONObject("taskAssignee");
//            String[] g = js.getString("userGroup").split(",");
//            List<String> group = new ArrayList<>();
//            for (int i = 0; i < g.length; i++) {
//                group.add(g[i]);
//            }
//            execution.setVariable("userGroup", group);
//            execution.setVariable("userGroupSize", group.size());
//
//        } catch (Exception e) {
//            logger.error("RemindStartHandler处理异常，结束处理。processid=" + execution.getProcessInstanceId(), e);
//            throw new RuntimeException("RemindStartHandler处理异常，结束处理。processid=" + execution.getProcessInstanceId(), e);
//        }
    }

}